#ifndef __COUNTABLE_H__
#define __COUNTABLE_H__

template<typename T>
class Countable
{
public:
	Countable() { ++count; }
	Countable(const Countable&) { ++count; }
	virtual ~Countable() { --count; }

	static size_t howMany()
	{ return count; }

private:
	static size_t count;
};

template<typename T>
size_t
Countable<T>::count = 0;

#endif
